#!/usr/bin/env bash

# Copyright (C) Lightbend Inc. <https://www.lightbend.com>

# shellcheck source=scripts/scriptLib
. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib"

cd "$BASEDIR"

start clean "CLEANING IVY LOCAL REPO"
rm -rf $HOME/.ivy2/local
end clean "CLEANED IVY LOCAL REPO"

start publish-local "CROSS-PUBLISHING PLAY LOCALLY FOR SBT SCRIPTED TESTS"
runSbt +publishLocal
end publish-local "CROSS-PUBLISHED PLAY LOCALLY FOR SBT SCRIPTED TESTS"

start save-akka-version "SAVING AKKA_VERSION AND AKKA_HTTP_VERSION"
echo "$AKKA_VERSION" > $HOME/.ivy2/local/com.typesafe.play/AKKA_VERSION
echo "$AKKA_HTTP_VERSION" > $HOME/.ivy2/local/com.typesafe.play/AKKA_HTTP_VERSION
end save-akka-version "SAVED AKKA_VERSION AND AKKA_HTTP_VERSION"
